package com.sunnyint.orderprinter.controller;

import com.sunnyint.orderprinter.entity.OrderInfo;
import com.sunnyint.orderprinter.service.PrintService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/printer")
public class PrinterController {

    @Autowired
    private PrintService printService;

    @PostMapping("/print")
    public String print(@RequestBody OrderInfo orderInfo){
        if(orderInfo == null){
            return "order info is null";
        }
//        printService.printOrder(orderInfo);
        return "success";
    }
}
